feat(evidence): add bounded WARC resource records - #210
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesWARC resource 레코드
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: 🟠 High · up to This PR adds WARC resource serialization, but the current implementation can allow multiply encoded nested credential parameters to bypass admission and be emitted in WARC-Target-URI, while payload binding and a WARC header assertion still have unresolved correctness concerns. Merge should be blocked until these security and correctness issues are fixed. Sequence Diagram(s)sequenceDiagram
participant 호출자
participant ProvenanceRecord
participant WarcResourceRecord
participant SHA256Digest
participant WARCBytes
호출자->>ProvenanceRecord: 쿼리 URL과 출처 해시 제공
호출자->>WarcResourceRecord: new_with_completeness 호출
WarcResourceRecord->>ProvenanceRecord: source URL과 검증 상태 확인
WarcResourceRecord->>SHA256Digest: 보존된 payload 전달
SHA256Digest-->>WarcResourceRecord: SHA-256 block digest 반환
WarcResourceRecord->>WARCBytes: WARC 헤더와 payload 전달
WARCBytes-->>호출자: 결정적 WARC/1.1 바이트 반환
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 51.35% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 74 functions across 10 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head product diff. Coverage is a separate gate.
Changed files
ARCHITECTURE.md— repository behaviorCHANGELOG.md— repository behaviorCargo.lock— Rust workspace or package manifestcrates/originweave-evidence/Cargo.toml— Rust workspace crate API and testscrates/originweave-evidence/src/lib.rs— Rust workspace crate API and testscrates/originweave-evidence/src/warc_resource_record.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/evidence.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/provenance_query_urls.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/warc_debug_redaction.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/warc_field_limit_errors.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/warc_payload_provenance_binding.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/warc_resource_record.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/warc_target_uri_presentation.rs— Rust workspace crate API and testscrates/originweave-evidence/tests/warc_truncation_state.rs— Rust workspace crate API and testsdocs/adr/0106-provenance-evidence-model.md— operator or user guidancedocs/doctoring.md— operator or user guidance
Changed behavior
classDiagram
class HttpMethod
class EvidenceSourceKind
class VerificationResult
class EvidenceError
class NetworkEvidence
class capture
class path
class ProvenanceRecord
Changed API
HttpMethodEvidenceSourceKindVerificationResultEvidenceErrorNetworkEvidencecapturepathProvenanceRecordnewsource_urlsource_locatorsource_hashWarcTruncationReasonWarcPayloadCompletenessWarcResourceRecordErrorWarcResourceRecordnew_with_completenessrecord_idwarc_datetarget_uricontent_typepayloadblock_digestto_warc_bytes
Findings
No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.
- Head SHA:
0341079331f9cea669eb9a5cc21842fd6027431e - Workflow run: 33179004673
- Workflow attempt: 1
- Coverage gate:
failure
Review outcome
Coverage is a gate, not the review. This body reviews the changed product files.
Changed-File Evidence Map
classDiagram
class HttpMethod
class EvidenceSourceKind
class VerificationResult
class EvidenceError
class NetworkEvidence
class capture
class path
class ProvenanceRecord
OpenCode Review Overview
Coverage evidence did not pass, so approval is blocked. The formal pull-request review is the source-backed diff review, not this status comment. |
* test(evidence): require WARC PROV JSON-LD bundle * feat(evidence): add bounded WARC PROV bundle * feat(evidence): expose WARC PROV bundle * test(evidence): cover provenance debug redaction * test(evidence): preserve WARC completeness in PROV * fix(evidence): retain WARC completeness in PROV * test(evidence): pin completeness-aware PROV output * style(evidence): apply canonical Rust formatting * style(evidence): format completeness regression * docs(evidence): record completeness-aware PROV bundle * docs(evidence): doctor PROV completeness semantics * test(evidence): prove PROV binds exact WARC record * fix(evidence): bind PROV to serialized WARC record * test(evidence): pin serialized WARC digest in PROV * test(evidence): require offline WARC PROV verification * feat(evidence): verify WARC PROV bindings offline * feat(evidence): export offline WARC PROV verification error * docs(changelog): record offline WARC PROV verification * test(evidence): require exact WARC provenance binding * fix(evidence): bind offline PROV verification to exact source evidence * style(evidence): apply canonical rustfmt * test(evidence): keep provenance regression clippy-clean * test(prov): reject null software revision identity * fix(prov): reject null Git software identity * feat(evidence): expose PROV bundle on current stack * docs(evidence): document WARC PROV bundle boundary * docs(evidence): trace WARC PROV bundle boundary * refactor(evidence): share WARC truncation tokens * fix: make WARC provenance digest binding authoritative
Buyer-visible boundary
This PR adds a bounded in-memory WARC 1.1 resource record over already-authorized bytes plus the integrated WARC/PROV child evidence. It binds target URI to independently verified provenance, bounds record fields before serialization, emits deterministic bytes, records complete-versus-truncated capture state, and keeps generic evidence credential-free.
Safe query-bearing resource URLs remain supported. Provenance admission rejects case-insensitive and percent-encoded credential field names at the top level and inside nested query-like values, residual nested percent-encoding in credential names, and singly or recursively percent-encoded ASCII controls before retention or WARC serialization.
Test-first security lineage
Earlier RED regressions reproduced encoded-control admission with realistic doubly and triply percent-encoded query controls. The production query boundary now decodes validated percent escapes until no further escape remains and rejects ASCII controls at every level while preserving the credential-name policy; regressions cover
%250A,%2509,%257F, and%25250Abefore provenance or WARC retention.The WARC/PROV child keeps deterministic JSON-LD/offline-verification evidence in-memory only. It does not claim durable object storage, retention, encryption, legal hold, authenticated export, browser/network capture authority, or persistence.
Fresh protected-main adoption
Protected
mainis exactc789b802fc98a8d7fd8c09d9327f36828054d2a1. Previous exact head7946dce9a3dd074047d93fca299d48c7aef40e47targeted oldmain@542ca1e9c0a863595b8b6697790005d2471f5413; the two protected-main commits after that revision have no net file delta.Commit
62378dfa6ae752abfa53540e0429831f417e0af9adopts current protected main as a second parent while preserving the predecessor evidence/product tree exactly. The branch advanced by normal non-force fast-forward. Fresh compare is 102 ahead / 0 behind, merge base exactly current protected main, with 22 semantic paths limited to evidence production/tests, WARC/PROV dependencies, architecture/ADR/doctoring, focused documentation contracts, and the narrow Unreleased evidence/security entries. No.github/**, provider/model, browser/network/TLS authority, secret, ruleset, or coverage-denominator change is introduced.Exact-current evidence
Current exact head is
62378dfa6ae752abfa53540e0429831f417e0af9; GitHub reports the PR open, Draft, and content-mergeable. Earlier CI/security/review results remain predecessor evidence only.Fresh exact-head workflows are non-terminal:
33777881369: queued;33777881387: queued;33777881241: queued;33777882017: queued;33777881366: queued; andMaterialize Rust nightly refresh once33777881233: completed as skipped and is not product evidence.No exact-current GREEN or independent approval is claimed. Keep Draft until repository contracts, strict Rust checks/rustdoc, exact 100% owned-production function/line/region/branch coverage, applicable security/review verdicts, and live governance execute on the unchanged head.
Protected-main
AGENTS.mdand live GitHub governance remain authoritative. This scheduled writer does not merge, self-approve, bypass, force-push, destructively rebase, alter workflows/rulesets/secrets, weaken checks, tag, release, or publish.